import { TokenAction } from '@/types/store'
import { Token } from '@/types/data'
const initialState: Token = {
  token: '',
  refresh_token: '',
}

const login = (state = initialState, action: TokenAction): Token => {
  switch (action.type) {
    case 'login/token':
      return action.payload
    case 'login/logout':
      return initialState
    default:
      return state
  }
}

export default login
